package com.paas.form.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;

import com.paas.form.dao.FormAttributeDao;
import com.paas.form.entity.FormAttributeEntity;
import com.paas.form.service.IFormAttributeService;
import com.paas.common.web.service.BaseServiceImpl;

import java.util.List;

@Service("formAttributeService")
public class FormAttributeServiceImpl  extends BaseServiceImpl<FormAttributeDao,FormAttributeEntity> implements IFormAttributeService{

    @Override
    public List<FormAttributeEntity> getListByViewId(String viewId){
        //定义查询构建器
        QueryWrapper<FormAttributeEntity> queryWrapper = new QueryWrapper<FormAttributeEntity>();
        queryWrapper.eq("view_id",viewId);
        queryWrapper.eq("status","1");
        return this.baseMapper.selectList(queryWrapper);
    }

    /**
     * 批量查询视图属性
     * @param viewIds 视图id集合
     * @return
     */
    @Override
    public List<FormAttributeEntity> getListByViewIds(List<String> viewIds){
        //定义查询构建器
        QueryWrapper<FormAttributeEntity> queryWrapper = new QueryWrapper<FormAttributeEntity>();
        queryWrapper.in("view_id",viewIds);
        queryWrapper.eq("status","1");
        return this.baseMapper.selectList(queryWrapper);
    }
	
}